# coding=utf-8
# Time : 2020/10/9 15:08
# Author : huxin

from flask import Flask
from common.YmlUtil import YmlUtil
import os

from task.zysTask import SchedulerConfig1
from view import *
from flask_apscheduler import APScheduler
from task.task import *

app = create_app()

abPath = os.path.abspath(__file__)
path = abPath.replace('py', 'yml')
port = YmlUtil.readYml(path=path, key='server', para='port')


if __name__ == '__main__':

    app.config.from_object(SchedulerConfig1())
    scheduler = APScheduler()
    scheduler.init_app(app)
    scheduler.start()
    app.run(host='0.0.0.0', port=port, debug=False)